﻿using System.Windows.Forms;
using mshtml;

namespace Report.BrowserFix
{
    public class HTMLDocumentAccessor
    {
        private readonly HTMLDocumentClass document;

        public HTMLDocumentAccessor(HtmlDocument document)
        {
            this.document = (HTMLDocumentClass) document.DomDocument;
        }

        public int ScrollTop
        {
            get { return (int) document.documentElement.getAttribute("scrollTop", 0); }
            set { document.documentElement.setAttribute("scrollTop", value, 0); }
        }
    }
}